package com.wtwd.device.constant;

public enum AuthCodeTypeEnum {

    REGISTER(1, "SMS_215200248", "SMS_248815634","register.html", " You are registering for a new account. The validation code is {code}.The validation information will expire in 2 minutes.")
    ,MODIFY_PASSWORD(2, "SMS_215200247", "SMS_248760615","modify_password.html", "You are trying to retrieve the password. The validation code is {code}.The validation information will expire in 2 minutes.")
    ,MODIFY_ACCOUNT(3,"SMS_215200246","SMS_248900632","modify_account.html","")
    ;
    private Integer type;
    private String smsTemp;
    private String smsTempINT;
    private String emailTemp;
    private String context;

    AuthCodeTypeEnum(Integer type, String smsTemp, String smsTempINT,String emailTemp, String context) {
        this.type = type;
        this.smsTemp = smsTemp;
        this.smsTempINT = smsTempINT;
        this.emailTemp = emailTemp;
        this.context = context;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public void setSmsTemp(String smsTemp) {
        this.smsTemp = smsTemp;
    }

    public String getSmsTempINT() {
        return smsTempINT;
    }

    public void setSmsTempINT(String smsTempINT) {
        this.smsTempINT = smsTempINT;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public static String getSMSTemp(Integer type) {
        for (AuthCodeTypeEnum r : AuthCodeTypeEnum.values()) {
            if (r.getType() == type) {
                return r.getSmsTemp();
            }
        }
        return null;
    }

    public static String getSMSTempINT(Integer type) {
        for (AuthCodeTypeEnum r : AuthCodeTypeEnum.values()) {
            if (r.getType() == type) {
                return r.getSmsTempINT();
            }
        }
        return null;
    }

    public static String getEmailTemp(Integer type) {
        for (AuthCodeTypeEnum r : AuthCodeTypeEnum.values()) {
            if (r.getType() == type) {
                return r.emailTemp;
            }
        }
        return null;
    }


    public static String getSMSContent(Integer type) {
        for (AuthCodeTypeEnum r : AuthCodeTypeEnum.values()) {
            if (r.getType() == type) {
                return r.getSmsTemp();
            }
        }
        return null;
    }

    public static AuthCodeTypeEnum getAuthCodeTypeEnum(Integer type) {
        for (AuthCodeTypeEnum r : AuthCodeTypeEnum.values()) {
            if (r.getType() == type) {
               return r;
            }
        }
        return null;
    }


    public Integer getType() {
        return type;
    }

    public String getSmsTemp() {
        return smsTemp;
    }

    public String getContext() {
        return context;
    }
}
